package com.eastfair.questionnaire.service;

import com.eastfair.enums.SystemSourceEnum;
import com.eastfair.questionnaire.dto.AnswerResultDTO;
import com.eastfair.questionnaire.dto.ExternalAnswerDTO;
import com.eastfair.questionnaire.dto.InternalAnswerDTO;
import com.eastfair.questionnaire.vo.ExternalAnswerVO;
import com.eastfair.questionnaire.vo.InternalAnswerVO;
import javafx.util.Pair;

import java.util.List;
import java.util.Map;

/**
*Description 对接其他系统问卷
*@Date 13:45 2021/8/28
*@param null
*@return
*@Author yuwx
**/
public interface RelationExternalAnswerService {
    /**
    *Description 保存问题映射
    *@Date 13:45 2021/8/28
    *@param projectId
    *@param systemSourceEnum
    *@param relation
    *@return void
    *@Author yuwx
    **/
    void saveQuestion(Long projectId, SystemSourceEnum systemSourceEnum, Pair<Long, String> relation);
    /**
    *Description 保存答案映射
    *@Date 13:45 2021/8/28
    *@param projectId
    *@param systemSourceEnum
    *@param relation
    *@return void
    *@Author yuwx
    **/
    void saveAnswer(Long projectId, SystemSourceEnum systemSourceEnum, Pair<Long, String> relation);
    /**
    *Description 转换内部答案为外部答案，key是问题id,value是答案id
    *@Date 13:50 2021/8/28
    *@param projectId
    *@param systemSourceEnum
    *@param internalAnswerDTOList
    *@return java.util.Map<java.lang.String,java.util.List<java.lang.String>>
    *@Author yuwx
    **/
    Map<String, List<ExternalAnswerVO>> convertInternalToExternal(Long projectId, SystemSourceEnum systemSourceEnum, List<InternalAnswerDTO> internalAnswerDTOList);
    /**
    *Description 转换外部答案为内部答案，key是问题id,value是答案id
     * 注意：按系统内的问题、答案结构返回
    *@Date 13:51 2021/8/28
    *@param projectId
    *@param systemSourceEnum
    *@param externalAnswerList
    *@return java.util.Map<java.lang.Long,java.util.List<java.lang.Long>>
    *@Author yuwx
    **/
    Map<Long, List<InternalAnswerVO>> convertExternalToInternal(Long projectId, SystemSourceEnum systemSourceEnum, List<ExternalAnswerDTO> externalAnswerList);

}
